package com.codeest.geeknews.model.http.api;

import com.codeest.geeknews.model.bean.DoubanLoginBean;

import io.reactivex.Flowable;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.Headers;
import retrofit2.http.POST;

/**
 * https://github.com/zonyitoo/doubanfm-qt/wiki/%E8%B1%86%E7%93%A3FM-API
 * Created by admin on 2017/8/22.
 */

public interface DoubanLoginApis {

    String HOST = "https://www.douban.com/";


    /**
     * 登录接口
     *
     * @param apikey-
     * @param client_id-
     * @param client_secret-
     * @param udid-
     * @param douban_udid-
     * @param device_id-
     * @param grant_type-
     * @param redirect_uri-
     * @param username-
     * @param password-
     * @return -
     */
    @Headers({"Content-Type: application/x-www-form-urlencoded"})
    @POST("service/auth2/token")
    @FormUrlEncoded
    Flowable<DoubanLoginBean> login(
            @Field("apikey") String apikey, @Field("client_id") String client_id,
            @Field("client_secret") String client_secret, @Field("udid") String udid,
            @Field("douban_udid") String douban_udid, @Field("device_id") String device_id,
            @Field("grant_type") String grant_type, @Field("redirect_uri") String redirect_uri,
            @Field("username") String username, @Field("password") String password);


}
